Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@stephentoub
Copy link
Member

I noticed a few places where allocations were occurring unnecessary:

  • Across several of the immutable and XML collection types, the ICollection.CopyTo implementations were calling Array.SetValue in a loop; the second parameter to SetValue is a params array, so each iteration of the loop was resulting in allocating a new array... I've lifted that implicit allocation out to be an explicit one before the loop.
  • In a couple of places in the XML library and the metadata reader, string.Trim* was being used, either with an array of the same characters unnecessarily being allocated each time, or an implicitly allocated array of constant chars to fill a params array parameter. I've replaced those with statically cached arrays.
  • In a couple of places in the XML library, a string was being constructed around a single character via creating a new char array; I've replaced that with usage of string's ctor that takes a character and a count, avoiding the unnecessary char[] allocation.

@stephentoub
Copy link
Member Author

ps In the case of the loop around SetValue, I contemplated adding if checks to avoid the allocation in the case where the collection being copied from is empty. I'd initially opted not to, under the assumption that copying from an empty collection using ICollection.CopyTo is uncommon. But looking at it again I think I will. Closing the pull request; I'll reissue it.

pgavlin pushed a commit to pgavlin/corefx that referenced this pull request Sep 8, 2015
Code changes coming from Project K
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
Olafski pushed a commit to Olafski/corefx that referenced this pull request Jun 15, 2017
This commit fixes dotnet#11 - Add getting started links to readme.md
ravimeda added a commit that referenced this pull request Jun 16, 2017
* Create root and windows definition.

* Include PB_ prefix.

* Remove variables whose values will be in PB.

* Remove unnecessary tasks.

* Update path property.

* Add OSX leg.

* Remove triggers.

* Remove PB variables.

* Remove OSX leg since there is no TSA support.

* Remove CodeMetrics.

* Pass official build number as PB variable.

* Invoke sync.cmd directly.

* Update arguments passed to security tools. (#11)

* Minor fixes to arguments passed, and variable names.  (#12)

* Remove folders other than security.

* Update args for BinSkim.

* Cleanup scripts.

* Fix APIScan args.

* Update task names.

* Update PB variable name.

* Do delete .txt files. Version.txt is needed.

* Set symbolsFolder for APIScan.

* Update git checkout task.

* Add a test task that will be removed before merge.

* Add PB_Git variable.

* Update Git path.

* Revert to PB_Git.

* Remove test task.
@Anipik Anipik removed this from the 1.0.0-rtm milestone Aug 22, 2018
@karelz karelz added this to the 1.0.0-rtm milestone Nov 15, 2018
@karelz
Copy link
Member

karelz commented Nov 15, 2018

@Anipik one more ... just FYI

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Create root and windows definition.

* Include PB_ prefix.

* Remove variables whose values will be in PB.

* Remove unnecessary tasks.

* Update path property.

* Add OSX leg.

* Remove triggers.

* Remove PB variables.

* Remove OSX leg since there is no TSA support.

* Remove CodeMetrics.

* Pass official build number as PB variable.

* Invoke sync.cmd directly.

* Update arguments passed to security tools. (dotnet/corefx#11)

* Minor fixes to arguments passed, and variable names.  (dotnet/corefx#12)

* Remove folders other than security.

* Update args for BinSkim.

* Cleanup scripts.

* Fix APIScan args.

* Update task names.

* Update PB variable name.

* Do delete .txt files. Version.txt is needed.

* Set symbolsFolder for APIScan.

* Update git checkout task.

* Add a test task that will be removed before merge.

* Add PB_Git variable.

* Update Git path.

* Revert to PB_Git.

* Remove test task.


Commit migrated from dotnet/corefx@114dc02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants